﻿public class PrintTest {
	
	public static void main(String[] args) {
		//1.定义打印机

		PrintInkBox inkBox=null;
		PrintPaper paper=null;
		Printer printer=new Printer(); 
		
		//2.使用黑白墨盒在A4纸上打印

		inkBox =new PrintGrayInkBox();
		paper=new PrintA4Paper();
		printer.setInkBox(inkBox);
		printer.setPaper(paper);
		printer.print();
		
		//3.使用彩色墨盒在B5纸上打印

		inkBox =new PrintColorInkBox();
		paper=new printB5Paper();
		printer.setInkBox(inkBox);
		printer.setPaper(paper);
		printer.print();
		
		//4.使用彩色墨盒在A4纸上打印

		paper=new PrintA4Paper();
		printer.setPaper(paper);
		printer.print();
	}
}